<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
		<script src="./js/jquery-latest.js" type="text/javascript" charset="utf-8"></script>
		<script src="./js/plainTemplate.js" type="text/javascript" charset="utf-8"></script>
-->
		<link rel="stylesheet" href="./styles.css" include="1" type="text/css" media="screen" charset="utf-8">
		<title>phpQuery &amp; plainTemplate</title>
</head>
<body>
		<h1>phpQuery &amp; plainTemplates</h1>

		<p>plainTemplates is a PHP and JS library that aims to divide template into 2 separate layers:</p>
		<ol>
			<li>CSS selectors driven data attaching mechanism</li>
			<li>Plain HTML</li>
		</ol>
		<p>It's basen on <strong>phpQuery</strong> - a <a href="http://jquery.com/">jQuery</a> port to PHP.</p>
		<p><strong>Get the source:</strong></p>
		<ul>
			<li><a href="http://plaintemplates.googlecode.com/files/plainTemplates-0.4-beta.zip">Lastest release 0.4 beta</a> (includes phpQuery 0.6 beta)</li>
			<li><a href='http://plaintemplates.googlecode.com/svn/trunk/'>plainTemplates SVN repository</a> (anonymous)</li>
			<li><a href='http://phpquery.googlecode.com/svn/trunk/'>phpQuery SVN repository</a> (anonymous)</li>
		</ul>
		<p>Please send bugs and suggestions to <em>@tobiasz.cudnik/gmail</em></p>
		<div class="phpQuery column">
			<h2>phpQuery - jQuery for PHP</h2>
			<p>phpQuery is PHP-port of well known and great web2.0 JS library, which <a href="http://jquery.com/">jQuery</a> is.</p>
			<p>It's not something like <a href="http://projects.cyberlot.net/trac/jqpie/wiki">JQPie</a>, which is form of JS code generator and server-client layer.</p>
			<p>Eg You can do something like:</p>

			<pre>&lt;php
print _('file.htm')
    -&gt;('body div.cls1.cls2 ul &gt; li:first')
        -&gt;parent()
            -&gt;prepend('&lt;li&gt;my new first LI&lt;/li&gt;')
            -&gt;parents('.myClass')
                -&gt;remove()
                -&gt;end()
            -&gt;appendTo('body')
            -&gt;parents('html')
                -&gt;html();
?&gt;
			</pre>
			<p>It works on DOM Extension and is designed for PHP5 only.</p>
			<p>There is almost no docs yet, so please refer to <a href='http://docs.jquery.com/Main_Page'>jQuery's one</a> (DOM section).</p>
		</div>
		<div class="plainTemplatePHP column">
			<h2>plainTemplates for Programmer</h2>
			<p>In typical MVC the Controller passes data to View, which is (generally) a fragment of HTML page with some code markup - it can be pure PHP, <a href="http://smarty.php.net/">Smarty</a> and even something like <a href="http://phptal.motion-twin.com/">PHPTAL</a>.</p>

			<p>All this stuff makes View (template) hard to preview without parsing by Controller and joining with main wrapping template.</p>
			<p>In <strong>plainTemplate</strong> the above proccess is transparent.</p>
			<ul>
				<li>Write selectors based on HTML structure</li>
				<li>Pass those selectors and Controller data to plainTemplate</li>
				<li>plainTemplates parses template, removing desinger's example data</li>
				<li>If there is a need, You can manually write template proccessing rules with phpQuery - a jQuery port to PHP</li>
				<li>Everything caches to pure, human-readable PHP file, similar to that one written with no template engine</li>
				<li>From one HTML file You can build several templates</li>
				<li>From several HTML files You can build one template (source HTML is joinded-on-the-fly)</li>
				<li>Once the Designer updates the file, the cached template updates itself transparently
			</li></ul>
		</div>
		<div class="plainTemplates column">
			<h2>plainTemplates for Designer</h2>

			<p>You don't want to write loops, if's and data bindings in templates. Insted of that You want to have a full and easy preview of You work.</p>
			<p>With plainTemplates You can have all those things.</p>
			<h3>How it works:</h3>
			<ul>
				<li>Prepare template purly in HTML</li>
				<li>Fill it with example data, which can be shown to Client</li>
				<li>You can transparently divid HTML page into smaller parts for comfort work</li>
				<li>Proccess of joining divaded parts is transparent and works on all browsers, also locally (file://)</li>
				<li>Joined templates works with live-preview in almost any web-edtor witch embended browser</li>
				<li>You can define your own template file structure, independed from framework used by Programmer.</li>
				<li>Last but not least You can save your work effect (HTML &amp; CSS) in <a href="http://www.getfirebug.com/">Firebug</a> (with hotkey or simple GUI)</li>

			</ul>
			<p>Firebug save feature requires PHP support on filesystem.</p>
			<p>For proper working of AJAX locally in IE7 You need a bit patched jQuery, which is included.</p>
			<p>Read comments in <em>demo.htm</em> for more advanced tips.</p>
		</div>
</body>
</html>